/**
 * 输入：s = "We are happy."
 输出："We%20are%20happy."
 */
var s = "We are happy"

/**
 * @param {string} s
 * @return {string}
 */
var replaceSpace = function(s) {
    return s.split(' ').join('%20')
};
console.log(replaceSpace(s))